//
//  QLLiveVideoListVC.m
//  神约
//
//  Created by qlwl on 17/1/24.
//  Copyright © 2017年 qlwl. All rights reserved.
//

#import "QLLiveVideoListVC.h"

@interface QLLiveVideoListVC ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIView *lineView;

@end

@implementation QLLiveVideoListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
#pragma mark topBtnClick
- (IBAction)topBtn1Click:(id)sender {
    [self selectBtns:sender];
}
- (IBAction)topBtn2Click:(id)sender {
    [self selectBtns:sender];
}
- (IBAction)topBtn3Click:(id)sender {
    [self selectBtns:sender];
}

- (void)selectBtns:(UIButton *)btn
{
    for (UIView * subView in btn.superview.subviews) {
        if ([subView isKindOfClass:[UIButton class]]) {
            ((UIButton *)subView).selected = NO;
            ((UIButton *)subView).userInteractionEnabled = YES;
        }
    }
    btn.selected = YES;
    btn.userInteractionEnabled = NO;
    [self lineViewMoveToBtn:btn];
}
- (void)lineViewMoveToBtn:(UIButton *)btn
{
    [UIView animateWithDuration:0.2 animations:^{
        self.lineView.center = CGPointMake(btn.center.x, self.lineView.center.y);
    }];
}


#pragma mark TabDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 10;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLLiveVideoListCell"];
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return (iphoneWidth - 20) + 10 + 56;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 8;
}


@end
